package com.starlink.model.util;

import com.starlink.model.dtomapper.SchoolbagPhaseBooksDtoMapper;
import com.starlink.model.domain.SchoolbagPhaseBooksDO;
import com.starlink.model.vo.SchoolbagPhaseBooksVO;
import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zhanghong
 */
public class SchoolbagPhaseBooksConvert {

    public static List<SchoolbagPhaseBooksVO> buildSchoolbagPhaseBooksVoList(List<SchoolbagPhaseBooksDO> schoolbagPhaseBooksDOList) {
        if (CollectionUtils.isEmpty(schoolbagPhaseBooksDOList)) {
            return Lists.newArrayList();
        }
        List<SchoolbagPhaseBooksVO> schoolbagPhaseBooksVOList = new ArrayList<>();
        for (SchoolbagPhaseBooksDO schoolbagPhaseBooksDO : schoolbagPhaseBooksDOList) {
            schoolbagPhaseBooksVOList.add(SchoolbagPhaseBooksDtoMapper.INSTANCE.do2VO(schoolbagPhaseBooksDO));
        }

        return schoolbagPhaseBooksVOList;
    }
}
